package com.ai.service;

import com.ai.mapper.AdminMapper;
import com.ai.service.impl.AdminServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wst.ai.pojo.admin.Admin;

@Service
public class AdminService implements AdminServiceImpl {
    @Autowired
    private AdminMapper adminMapper;
    @Override
    public Admin login(String userName, String password) {
        QueryWrapper<Admin> wrapper = new QueryWrapper<>();
        wrapper.eq("username",userName).eq("password",password);
        Admin admin = adminMapper.selectOne(wrapper);
        return admin;
    }

    @Override
    public Admin getUserInfo(String userId) {
        Admin admin = adminMapper.selectById(userId);
        return admin;
    }
}
